<div id="stats_container">
    <h1 align="center">Statistics</h1>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <th class="stats_title" scope="col" width="33%" style="background-color:#d3d3d3;color:white">Top File
                Views
            </th>
            <th class="stats_title" scope="col" style="background-color:#d3d3d3;color:white">Top Image Views</th>
            <th class="stats_title" scope="col" width="33%" style="background-color:#d3d3d3;color:white;">Top User</th>
        </tr>
        <tr>
            <td valign="top" align="center">
                <?
                if (isset($file_query) && $file_query->num_rows() > 0) {
                    $count = 1;
                    foreach ($file_query->result() as $row)
                    {
                        echo '<div style="float:left;color:blue">' . $count++ . '&nbsp;</div>';
                        echo '<div style="float:left;overflow:hidden;width:280px;text-align:left;">' . $row->file_name .
                             ' <span style="color:gray;font-size:14px;">by ' .
                             $row->file_owner_username . '</span></div>';
                        echo '<div style="float:right;">' . $row->file_visted . ' VIEWS</div>';
                        echo '<br/><hr class="sp"/>';
                    }
                }
                else
                {
                    echo '<div>NO DATA</div>';
                }
                ?>
            </td>
            <td valign="top" align="center">
                <?
                if (isset($image_query) && $image_query->num_rows() > 0) {
                    $count = 1;
                    foreach ($image_query->result() as $row)
                    {
                        echo '<div style="float:left;color:blue">' . $count++ . '&nbsp;</div>';
                        echo '<div style="float:left;overflow:hidden;width:280px;text-align:left;">' . $row->name .
                             ' <span style="color:gray;font-size:14px;">by ' .
                             $row->owner . '</span></div>';
                        echo '<div style="float:right;">' . $row->visted . ' VIEWS</div>';
                        echo '<br/><hr class="sp"/>';
                    }
                }
                else
                {
                    echo '<div>NO DATA</div>';
                }
                ?>
            </td>
            <td valign="top" align="center">
                <?
                if (isset($user_query) && $user_query->num_rows() > 0) {
                    $count = 1;
                    foreach ($user_query->result() as $row)
                    {
                        echo '<div style="float:left;color:blue">' . $count++ . '&nbsp;</div>';
                        echo '<div style="float:left;overflow:hidden;width:250px;text-align:left;">'
                             . $row->username . '</div>';
                        echo '<div style="float:right">' . round($row->point, 2) . ' POINTS</div>';
                        echo '<br/><hr class="sp"/>';
                    }
                }
                else
                {
                    echo '<div>NO DATA</div>';
                }
                ?>
            </td>
        </tr>
    </table>
</div>
